#include "smart_ptr.h"

template<class T>
struct ListNode {
	ListNode(lixixi::shared_ptr sp) :_prev(sp) {}


	lixixi::shared_ptr<T> _prev;
	lixixi::shared_ptr<T> _next;
};


int main()
{
	int cnt = 1000;
	lixixi::shared_ptr<int> sp1(new int);
	*sp1 = 1;
	std::thread t1([&]() {
		for (int i = 0; i < cnt; i++)
			lixixi::shared_ptr<int> sp2 = sp1;
		});
	std::thread t2([&]() {
		for (int i = 0; i < cnt; i++)
			lixixi::shared_ptr<int> sp2 = sp1;
		});
	t1.join();
	t2.join();
	return 0;
}